#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
void qsort (void* base, size_t num, size_t size,
int(*compar)(const void*, const void*));
int compare_int(const void*p1, const void*p2)
{
	 return *(int*)p1 - *(int*)p2;
}
 void abd(int arr[], int sz)
 {
	 for (int i = 0; i < sz; i++)
	 {
		 printf("%d ", *(arr + i));//arr[i]
	 }
 }
 void bubble_sort(int arr[], int sz)
 {
	 int i = 0;
	 for (i = 0; i < sz - 1; i++)
	 {
		 int j = 0;
		 for (j = 0; j < sz - 1 - i; j++)
		 {
			 if (arr[j]>arr[j + 1])
			 {
				 int temp = 0;
				 temp = arr[j];
				 arr[j] = arr[j + 1];
				 arr[j + 1] = temp;
			 }
		 }
	 }
 }
int main()
{
	int arr[] = { 1, 2, 5, 2, 1, 7, 5, 4, 2 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	//qsort(arr, sz, sizeof(arr[0]), compare_int);
	bubble_sort(arr, sz);
	abd(arr, sz);
	system("pause");
	return 0;
}


